<template>
  <div class="hi">
    {{world}} + {{age}}
    <button @click="goHello">go hello</button>
    <button @click="changeBtn">go hello</button>
    <button @click="sendAge('18')">changeAGE</button>
  </div>
</template>

<script>
  import dd from 'dd'
  import store from './store/index'
  export default dd.component({
    data () {
      return {

      }
    },
    methods:{
      goHello(){
        const url = '/'
        this.$router.push({path:url})
      },
      changeBtn(){
        this.sendWorld("nan,jing")
      },
    },
    created(){
      console.log(this.$store.state.name)
    }
  },
    {
      state:{
        'self':['world','iphone'],
        'global':['age']
      },
      getters:{},
      mutations:{
        'self':['changeWorld']
      },
      actions:{
        'self':['sendWorld'],
        'global':['sendAge']
      }
    },
    {
      mName:'hi',
      store
    })



</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>

</style>
